package com.thiswhyme.stream.rabbit.producer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;

import com.thiswhyme.stream.rabbit.interceptor.BizMessageChannelInterceptor;
import com.thiswhyme.stream.rabbit.producer.channel.OutputChannel;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.config.GlobalChannelInterceptor;

@EnableBinding({OutputChannel.class})
@SpringBootApplication
public class StreamRabbitProducerApplication {

    @Bean
    @GlobalChannelInterceptor
    public BizMessageChannelInterceptor bizMessageChannelInterceptor() {
        return new BizMessageChannelInterceptor();
    }

    public static void main(String[] args) {
        SpringApplication.run(StreamRabbitProducerApplication.class, args);
    }

}
